﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Principal.Master" AutoEventWireup="true" CodeBehind="BrazosMinisterios.aspx.cs" Inherits="ProyectoSalvadorDelMundo.CatalogosGlobales.CatalogoBrazosMinisterios" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="contenidoPrincipal" runat="server">
    <form id="form1" runat="server">
        <asp:ToolkitScriptManager ID="toolkitdcriptmanager" runat="server" EnablePartialRendering="true">
        </asp:ToolkitScriptManager>
        <ul class="breadcrumb">
            <li>
                <asp:HyperLink ID="linkNav" runat="server"></asp:HyperLink>
                <span class="divider">/</span>
            </li>
            <li>
                <asp:Label ID="lblNavActiva" runat="server"></asp:Label>
            </li>
        </ul>
        <div>
            <div>
                <h3>
                    <asp:Label ID="lblTitulo" runat="server"></asp:Label></h3>
            </div>
            <div class="contentDiv">
                <div class="gridWrapper">
                    <div>
                    </div>

                    <div class="gridContainer">
                        <asp:UpdatePanel ID="udp" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>

                                <div class="input-group">
                                    <div class="input-group-btn">
                                        <asp:Button ID="btnAgregar" runat="server" OnClick="Agregar" CausesValidation="false" />&nbsp;&nbsp;
                                        

                                        <asp:ImageButton ID="btnBuscar" runat="server" OnClick="Buscar" />
                                    </div>
                                    <asp:TextBox ID="txtBuscar" runat="server" />
                                </div>
                                <asp:Label ID="lblMinisterio" runat="server" Text="Seleccione el Ministerio" AssociatedControlID="ddlMinisterio"></asp:Label>
                                <asp:DropDownList ID="ddlMinisterio" runat="server" OnSelectedIndexChanged="ddlMinisterio_SelectedIndexChanged" CausesValidation="False" AutoPostBack="True"></asp:DropDownList>
                                <asp:ListView ID="lsvLista" runat="server" GroupPlaceholderID="groupPlaceHolder1" ItemPlaceholderID="itemPlaceHolder1" OnPagePropertiesChanging="OnPagePropertiesChanging">
                                    <LayoutTemplate>
                                        <table class="table table-striped table-bordered table-condensed table-hover">
                                            <tr>
                                                <th style="width: 0px; display: none">ID
                                                </th>
                                                <th>Brasos Ministerio
                                                </th>
                                                <th>Editar/Eliminar
                                                </th>
                                            </tr>
                                            <asp:PlaceHolder runat="server" ID="groupPlaceHolder1"></asp:PlaceHolder>
                                            <tr>
                                                <td colspan="4">
                                                    <asp:DataPager ID="DataPager1" runat="server" PageSize="10" PagedControlID="lsvLista">
                                                        <Fields>
                                                            <asp:NextPreviousPagerField ButtonType="Link" FirstPageText="Primero" ShowFirstPageButton="true" PreviousPageText="Anterior" ShowPreviousPageButton="true" ShowNextPageButton="false" ShowLastPageButton="false" ButtonCssClass="navbar-link" />
                                                            <asp:NumericPagerField ButtonType="Link" NumericButtonCssClass="navbar-link" />
                                                            <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="false" ShowPreviousPageButton="false" NextPageText="Siguiente" ShowNextPageButton="true" LastPageText="Ultimo" ShowLastPageButton="true" ButtonCssClass="navbar-link" />
                                                        </Fields>
                                                    </asp:DataPager>
                                                </td>
                                            </tr>
                                        </table>
                                    </LayoutTemplate>
                                    <GroupTemplate>
                                        <tr>
                                            <asp:PlaceHolder runat="server" ID="itemPlaceHolder1"></asp:PlaceHolder>
                                        </tr>
                                    </GroupTemplate>
                                    <EmptyDataTemplate>
                                        <table runat="server" style="">
                                            <tr>
                                                <td><h1>No se encontraron registros.</h1></td>
                                            </tr>
                                        </table>
                                    </EmptyDataTemplate>
                                    <ItemTemplate>
                                        <td style="width: 0px; display: none">
                                            <asp:Label ID="ID" runat="server" Text='<%# Eval ("ID_BRAZO_MINISTERIO") %>'></asp:Label>
                                        </td>
                                        <td>
                                            <asp:Label ID="NOMBRE" runat="server" Text='<%# Eval ("NOMBRE") %>'></asp:Label>
                                        </td>
                                        <td style="width: 100px">
                                            <asp:LinkButton ID="linEditar" runat="server" OnClick="Editar" CausesValidation="false">Editar</asp:LinkButton>
                                            <asp:LinkButton ID="linEliminar" runat="server" OnClick="Eliminar" CausesValidation="false">Eliminar</asp:LinkButton>
                                        </td>
                                    </ItemTemplate>
                                </asp:ListView>
                                <asp:HyperLink ID="linkIrMinisterios" runat="server" CssClass="link" NavigateUrl="~/CatalogosGlobales/Ministerios/Ministerios.aspx"></asp:HyperLink>
                                <asp:Panel ID="pnlAgregarEditar" runat="server">
                                    <div class="modal-content  ">
                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <div class="modal-header">
                                                    <asp:Button ID="btnPopX" runat="server" CausesValidation="false" OnClick="CerrarPop" />
                                                    <h4>
                                                        <asp:Label ID="lblPopupTitulo" runat="server"></asp:Label></h4>
                                                </div>

                                                <div class="modal-body">
                                                    <div class="form-horizontal">
                                                        <div class="form-group">
                                                            <div class="col-sm-12">
                                                                <asp:TextBox ID="txtIdGrupo" runat="server" Style="width: 0px; display: none"></asp:TextBox>
                                                                <asp:TextBox ID="txtId" runat="server" Style="width: 0px; display: none"></asp:TextBox>
                                                                <asp:Label ID="lblAccion" runat="server"></asp:Label>
                                                            </div>
                                                        </div>
                                                        <div class="form-group">
                                                            <asp:Label ID="lblNombre" runat="server"></asp:Label>
                                                            <div class="col-sm-10">
                                                                <asp:TextBox ID="txtNombre" runat="server"></asp:TextBox>
                                                            </div>

                                                        </div>
                                                        <div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="modal-footer">
                                                    <asp:Button ID="btnPopCerrar" runat="server" CausesValidation="false" OnClick="CerrarPop" />
                                                    <asp:Button ID="btnPopGuardar" runat="server" OnClick="Guardar" />
                                                </div>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </div>
                                </asp:Panel>
                                <asp:LinkButton ID="lnkFalso" runat="server"></asp:LinkButton>
                                <asp:ModalPopupExtender ID="popup" runat="server" DropShadow="False"
                                    PopupControlID="pnlAgregarEditar" TargetControlID="lnkFalso"
                                    BackgroundCssClass="modalBackground">
                                </asp:ModalPopupExtender>
                                </span>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="lsvLista" />
                                <asp:AsyncPostBackTrigger ControlID="btnPopGuardar" />
                                <asp:AsyncPostBackTrigger ControlID="btnBuscar" />
                                <asp:AsyncPostBackTrigger ControlID="ddlMinisterio" EventName="selectedindexchanged" />
                            </Triggers>
                        </asp:UpdatePanel>
                        <asp:UpdateProgress ID="updateprogress" runat="server">
                            <ProgressTemplate>
                                <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999998; background-color: #000000; opacity: 0.7;">
                                    <span style="border-width: 0px; position: fixed; padding: 50px; background-color: #FFFFFF; font-size: 20px; left: 40%; top: 40%;">Cargando ...</span>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </div>
                </div>
            </div>
        </div>
    </form>
</asp:Content>
